A New Formulation of the Catch/Throw Mechanism
نویسندگان
چکیده
The catch/throw mechanism in Common Lisp gives a simple control structure for non-local exits. Nakano[7, 9] and Sato[13] proposed intuitionistic calculi with inference rules which give logical interpretations of the catch/throw-constructs. Although the calculi are theoretically well-founded, we cannot use the catch/throw mechanism for handling run-time errors in a meaningful way, because of the side-condition of the implication-introduction rule (the formulation rule of the -abstract). This de ciency is critical if we use higher-order functions with the catch/throw mechanism. In this paper, we propose a new formulation of catch/throw calculi, which has no side-condition on the implication-introduction rule. By restricting the types of thrown terms to data types (non-functional types) instead, we obtain a strongly normalizing calculus for the catch/throw mechanism where we can write higher-order functions which handles run-time errors.
منابع مشابه
A Constructive Formalization of the Catch and Throw Mechanism
The catch/throw mechanism is a programming construct for non-local exit. In the practical programming, this mechanism plays an important role when programmers handle exceptional situations. In this paper we give a constructive formalization which captures the mechanism in the proofs-as-programs notion. We introduce a modi ed version of LJ equipped with inference rules corresponding to the opera...
متن کاملStrong normalizability of the non-deterministic catch/throw calculi
The catch/throw mechanism in Common Lisp provides a simple control mechanism for non-local exit. We study typed calculi by Nakano and Sato which formalize the catch/throw mechanism. These calculi correspond to classical logic through the Curry-Howard isomorphism, and one of their characteristic points is that they have nondeterministic reduction rules. These calculi can represent various comput...
متن کاملTwo Extensions of Px System (extended Abstract)
Two extensions of PX system will be discussed. The extensions are ctPX (catch/throw PX) and mvPX (multiple values PX). ctPX is a PX system extended with Nakano's catch/throw logic. ctPX enables to extract LISP programs with catch/throw mechanism form natural proofs. mvPX is a PX system which uses multiple values rather than lists to keep a nite sequences of data. Programs extracted by ctPX are ...
متن کاملThe Non-deterministic Catch and Throw Mechanism and Its Subject Reduction Property
A simple programming language and its typing system is introduced to capture the catch and throw mechanism with its nondeterministic feature. The subject reduction property of the system, which compensates for the unpleasant feature of the non-determinism, is shown.
متن کاملA Classical Catch/Throw Calculus with Tag Abstractions and its Strong Normalizability
ions and its Strong Normalizability Yukiyoshi Kameyama and Masahiko Sato Department of Information Science, Kyoto University fkameyama,[email protected] Abstract. The catch and throw constructs in Common Lisp provides a means to implement non-local exits. Nakano proposed a calculus L c=t which has inference rules for the catch and throw constructs, and whose types correspond to the i...
متن کامل